<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/21 0021
 * Time: 11:31
 */

namespace app\admin\controller;

use app\admin\logic\Common as Common_logic;

class common extends Admin
{
    use \app\common\traits\Common;

    /**
     * 获取来源
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getSourceByChennel(){
        $qudao = $this->request->param();
        $common_logic = new Common_logic();
        $data = $common_logic->getChennelInSource($qudao);
        return $data;
    }

    public function getBanjiBySource(){
        $banji = $this->request->param();
        $common_logic = new Common_logic();
        $data = $common_logic->getSourceInBanji($banji);
        return $data;
    }

    /**
     * 根据组ID获取组成员
     * @return mixed
     * @author: Guo
     */
    public function getuserByGroup(){
        if($this->request->isPost()){
            $id = $this->request->param('depart_id');
            $auth_id = $this->request->param('auth_id');
            if($id == 0){
                $id = 3;
            }
            $res = self::getCommonModel()->getUserByDeparId($id,$auth_id);
            return json($res);
        }
    }
}